#ifndef GETINFTONET_H
#define GETINFTONET_H

#include <QObject>
#include<QPaintEvent>
#include<QNetworkAccessManager>
#include<QNetworkReply>
#include<QNetworkRequest>
#include<QJsonValue>
#include<QJsonArray>
#include<QJsonDocument>
#include<QJsonObject>
#include<QPixmap>
#include<QByteArray>
#include"public.h"
#include<fstream>
class Getinftonet : public QObject
{
    Q_OBJECT
public:
    explicit Getinftonet(QObject *parent = nullptr);

    void topost(QString url,QByteArray date); //处理post数据
    void getshopinftosend();  //店铺信息页面请求
    void getshopinfuptosend();


private:
    void netinit(); //网络初始化
    void replyFinished(QNetworkReply *reply); //店铺信息请求响应
    void getshopinftoimg(QNetworkReply *reply); //获取店铺图片
    void jsontoshopinf(QString json);

    void getmenutoup(QNetworkReply *reply);
    void getparamtomenu(QString json); //解析【菜品信息
    void getmenutoimg(QNetworkReply *reply); //获取菜品图片

    void getshopinfimgtosend(QString url); //店铺图片请求


    void getshopinftoup(QNetworkReply *reply);

    void slotgetmenulist(QNetworkReply *reply);  //订单
    void jsonmenulist(QString json);


signals:
   void getshopinftojson(structshopinf *inf);   //响应店铺信息
   void shopinfimg(QByteArray* img);                //响应店铺图片

   void sigmenus(QVector<mymenu> &menulist);   //菜单
   void sigmenulist(clihnum & menulist); // 订单

public slots:
   void slotshopinf_getf();
   void getmenulist(); // 订单 发起请求

private:
    QNetworkAccessManager* network_shopinf; //获取店铺信息
    QNetworkRequest* network_shopinfreq;

    QNetworkAccessManager* network_shopinfimg; //获取店铺图片
    QNetworkRequest* network_shopinfimgreq;

    QNetworkAccessManager* network_shopinfup; //店铺菜单获取
    QNetworkRequest* network_shopinfupreq;

    QNetworkAccessManager* network_sed; //普通发送 只需要接收服务器传来的 成功&失败
    QNetworkRequest* network_req;

    //clihnum
    QNetworkAccessManager* network_menulist; //店铺订单
    QNetworkRequest* network_menulistreq;

int idd ;

};

#endif // GETINFTONET_H
